# /**
# * Copyright (c) 2022 Beijing Jiaotong University
# * photlab is licensed under [Open Source License].
# * You can use this software according to the terms and conditions of the [Open Source License].
# *
# * You may obtain a copy of [Open Source License] at: [https://open.source.license/]
# *
# * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
# * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
# * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
# *
# * See the [Open Source License] for more details.
# */
# /**
# * Author: Shihao Xie
# * Created: Jul. 8, 2022
# * Supported by: National Key Research and Development Program of China
# */

# thrift --gen py ./interface/common_data_type.thrift
# thrift --gen js ./interface/common_data_type.thrift
include "graph_data_type.thrift"
include "file_data_type.thrift"
include "project_data_type.thrift"
include "engine_data_type.thrift"

namespace py phot_server.rpc.common_data_type
//namespace js photlab.commonDataType

exception PhotError{
    1:required ErrorCode code,
    2:required string errorType,
    3:required string message
}

enum ErrorCode{
    // PhotServer error code
    FileError = 100,
    FilePathError = 200,
    ResourceNotFoundError = 300,
    ParameterValueError = 400,
    ParseError = 500,
    TypeError = 600,
    IdDuplicationException = 700,

    // PhotEngine error code
    ConversionError = 10000,
    ModuleAnalysisError = 11000,
    DispatcherError = 12000,
    ArithmeticUnitError = 13000,
    VerificationError = 14000,
    ComputationalGraphGenerationError = 15000,
    EngineError = 16000,
    RunOutOfTime = 17000
}